// Api集中管理
const {
	http
} = uni.$u


// 入库列表
const warehouseIn = (data) => {
	return http.get(
		`admin/warehouseIn?page=${data.page}&perPage=${data.perPage}&date_start=${data.date_start}&date_end=${data.date_end}`
	)
}
// 新增/admin/warehouseIn
const addWarehouseIn = (data) => {
	return http.post('admin/warehouseIn', data)
}


/**
 * 入库：仓库商品规格（商品列表）get
 * 逻辑：先选择仓库，再调用接口
 * admin/goods/all/goods
 * warehouse_id
 */
const enterSpeciFication = (warehouse_id) => {
	return http.get(`admin/goods/all/goods?warehouse_id=${warehouse_id}&page=1&perPage=999`)
}


// 编辑入库信息
const redactBankDeatils = (id) => {
	return http.get(`admin/warehouseIn/${id}`)
}
// 入库商品列表
const getGoodsList = (id) => {
	return http.get(`admin/warehouseIn/getGoodsList/${id}`)
}
// 编辑
const amendLibrary = (id, data) => {
	return http.post(`admin/warehouseIn/${id}`, data)
}

// 出库列表
const warehouseOut = (data) => {
	return http.get(
		`admin/warehouseOut?page=${data.page}&perPage=${data.perPage}&date_start=${data.date_start}&date_end=${data.date_end}`
	)
}
// 出库详情--传id
const outDeatils = (id) => {
	return http.get(
		`admin/warehouseOut/${id}`
	)
}



export {
	warehouseIn,
	addWarehouseIn,
	enterSpeciFication,
	redactBankDeatils,
	getGoodsList,
	amendLibrary,
	warehouseOut,
	outDeatils
}